package mvc.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
/**
 * @author cyt
 * @create 2020-08-15 12:49
 */
public class MyDispatcherServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
    /**
     *
     * 添加根容器
     * @return
     */
    @Override
    protected Class<?>[] getRootConfigClasses() {
        System.out.println("添加根容器");
        return new Class[]{SpringConfig.class};
    }
    /**
     * 添加 子容器
     * @return
     */
    @Override
    protected Class<?>[] getServletConfigClasses() {
        System.out.println("添加 子容器");
        return new Class[]{AppConfig.class};
    }
    /**
     *
     * @return
     */
    @Override
    protected String[] getServletMappings() {
        System.out.println("添加spring mvc的映射路径");
        return new String[]{"/"};
    }
}
